package com.project.platform.mapper;

import com.project.platform.entity.Staff;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;


public interface StaffMapper {
    List<Staff> queryPage(Integer offset, Integer pageSize, @Param("query") Map<String, Object> query);

    int queryCount(@Param("query") Map<String, Object> query);

    @Select("SELECT * FROM staff WHERE id = #{id}")
    Staff selectById(Integer id);

    @Select("SELECT * FROM staff")
    List<Staff> list();

    int insert(Staff entity);

    int updateById(Staff entity);

    boolean removeByIds(List<Integer> ids);

    @Select("SELECT * FROM staff WHERE username = #{username}")
    Staff selectByUserName(String username);

    @Select("SELECT * FROM staff WHERE tel = #{tel}")
    Staff selectByTel(String tel);
}